<%@ page language="java" pageEncoding="utf-8" %>

<html>

<head>
    <title>自行车停车场管理</title>
</head>
<body style="overflow: hidden;">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
    道路管理 <span class="c-gray en">&gt;</span>
    掘地施工地图
</nav>
<div style="width: 100%;height: 25px;background-color: #EEEEE0;line-height:25px">
    <div style="height:18px"></div>
    <div class="hideLeftT" style="margin-left:10px">
        <div id="refresh" class="hideLeftTwo"></div>
        <div id="text" class="refreshtext"><span>刷新</span></div>
    </div>

</div>
<div id="mapObj" style="width:99%;height:99%"></div>


</body>
</html>
<%@include file="../../head-ui.jsp" %>
<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/public/mapObj.js"></script>
<script type="text/javascript">
    var arrbiketitle = [];
    var mapObj = null;
    $(function () {
        mapObj = new MapEditor("mapObj", null)
        loadingdata();


    });


    $('#text').click(function(){
        mapObj.removeAll();
        loadingdata();
    });

    function loadingdata() {
        var arr = [];
        $.ajax({
            url: '<%=request.getContextPath()%>/back/digroad/listAll.do',
            type: 'POST',
            success: function (json) {
                for (var i = 0; i < json.data.length; i++) {
                    arr.push(mapObj.addMarker(linkmapcontent(json.data[i]),false,true));

                }
                if (arr.length != null) {
                    arr = [];
                    arrbiketitle = [];
                }
            }
        })
    }

    function linkmapcontent(obj) {

         var status = "";
        if(obj.status=='0'){
            status = "施工中";
            obj.imagename = "digroading";
        }else if(obj.status=='2'){
            status = "已超时";
            obj.imagename = "outtime";
        }else if(obj.status=='3'){
            status = "未施工";
            obj.imagename = "notdig";
        }


        var title = "<strong class='titlefont'>" + obj.roadname + "</strong>"
                + "" + "<hr class='ys'> </>" // 信息窗口标

        obj.content = "<div class='titlefont'> <strong>施工地点：</strong>" + obj.roadname +
                "<div><strong>施工编号：</strong>" + obj.licencenum + "</div>" +
                "<div><strong>施工类型：</strong>" + obj.digtype + "</div>" +
                "<div><strong>施工状态：</strong>" + status + "</div>";
        obj.title = mapObj.getwindow(280, 150, title);
        arrbiketitle.push(obj.title);
        return obj;
    }


</script>